﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace BLL
{
    public class Cryptography
    {
        /// <summary>
        /// 用md5加密
        /// </summary>
        /// <param name="Sourcein">输入的数据</param>
        /// <returns></returns>
        public static string MD5(string Sourcein)
        {
            MD5CryptoServiceProvider MD5CSP = new MD5CryptoServiceProvider();
            byte[] MD5Source = System.Text.Encoding.UTF8.GetBytes(Sourcein);
            byte[] MD5Out = MD5CSP.ComputeHash(MD5Source);
            return Convert.ToBase64String(MD5Out);
        }
    }
}
